import request from '@/utils/request';
import { praseStrEmpty } from '@/utils/tencreat';

// 查询合伙人列表
export function listpartner(query) {
	return request({
		url: '/mall/partner/list',
		method: 'post',
		data: query,
	});
}

// 查询用户详细
export function getpartner(id) {
	return request({
		url: '/mall/partner/getInfo',
		method: 'post',
		data: { id: id },
	});
}

// 新增用户
export function addpartner(data) {
	return request({
		url: '/mall/partner/add',
		method: 'post',
		data: data,
	});
}

// 编辑用户
export function updatepartner(data) {
	return request({
		url: '/mall/partner/edit',
		method: 'post',
		data: data,
	});
}

// 查询用户详细
export function getPartnerUser(userId) {
	return request({
		url: '/mall/partner/' + praseStrEmpty(userId),
		method: 'get',
	});
}
// 查询顶层地址
export function getArea() {
	return request({
		url: '/api/account/open/province',
		method: 'post',
	});
}

// 查询地区地址
export function getCity(data) {
	return request({
		url: '/api/account/open/city_county',
		method: 'post',
		data: data,
	});
}

// 查询市区地址
export function municipalAddress(data) {
	return request({
		url: '/api/account/open/city_county',
		method: 'post',
		data: data,
	});
}

// 删除用户
export function delpartner(id) {
	return request({
		url: '/mall/partner/remove',
		method: 'post',
		data: { id: id },
	});
}

// 导出用户
export function exportpartner(query) {
	return request({
		url: '/mall/partner/export',
		method: 'post',
		params: query,
	});
}

export function newListpartner(data) {
	return request({
		url: '/mall/partner/new_partner',
		method: 'post',
		data: data,
	});
}
export function getpartnerInfo(data) {
	return request({
		url: '/mall/partner/getInfo',
		method: 'post',
		data: data,
	});
}

export function getGrouplist(data) {
	return request({
		url: '/mall/partner/grouplist',
		method: 'post',
		data: data,
	});
}

export function getGroupDownlist(data) {
	return request({
		url: '/mall/partner/groupdownlist',
		method: 'post',
		data: data,
	});
}
